package com.uam.core.business.mode;

import com.uam.core.entity.model.AircraftModel;
import com.uam.core.entity.model.TaskModel;
import lombok.Data;
import org.json.simple.JSONArray;

import java.util.Date;

@Data
public class PointModel {
    private  Double lon;
    private  Double lat;
    private Date time;
    private  Date nextTime;

    private  Double speed;


    private double minAltitude = 0.00D;

    private double maxAltitude = 0.00D;

    private double safeDistance = 0.00D;

    private double maxDuration = 0.00D;
    private Integer index=0;

    public PointModel(Double lon, Double lat, Date time, Double speed,Date nextTime) {
        this.lat=lat;
        this.lon=lon;
        this.time=time;
        this.speed=speed;
        this.nextTime=nextTime;
    }

    public PointModel(){

    }

    public PointModel getPointModel(JSONArray jsonArray, AircraftModel aircraftModel, TaskModel taskModel) {
        PointModel pointModel=new PointModel();
        pointModel.setLon(Double.valueOf(jsonArray.get(0)+""));
        pointModel.setLat(Double.valueOf(jsonArray.get(1)+""));
        return pointModel;
    }
}
